package test.src.awt_swing;

import java.awt.*;

public class BorderLayoutDemo {
    public static void main(String[] args) {
        Frame frame = new Frame("这里演示BorderLayout");
        frame.setLayout(new BorderLayout(30, 10));
        Button buttonNorth = new Button("北侧按钮");
        Button buttonSouth = new Button("南侧按钮");
        Button buttonWest = new Button("西侧按钮");
        Button buttonEast = new Button("东侧按钮");
        Button buttonCenter = new Button("中间按钮");
        frame.add(buttonCenter, BorderLayout.CENTER);
        frame.add(buttonNorth, BorderLayout.NORTH);
        frame.add(buttonEast, BorderLayout.EAST);
        frame.add(buttonWest, BorderLayout.WEST);
        frame.add(buttonSouth, BorderLayout.SOUTH);
        frame.pack();
        frame.setVisible(true);
    }
}
